package cn.fu.tag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.SkipPageException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

/**
 * @Title: SkipPageOrEvalPage.java
 * @Package cn.fu.tag
 * @Description: 根据用户请求（url和超连接或表单） 选择是否显示标签后的内宅
 * @author zhangxiaofu
 * @Company www.viewhigh.com
 * @date 2016年7月23日 下午11:03:50
 * @version V1.0
 */
public class SkipPageOrEvalPage extends SimpleTagSupport {
	@Override
	public void doTag() throws JspException, IOException {
		PageContext pageContext = (PageContext) getJspContext();
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		String header = request.getHeader("referer");
		if (header == null) {
			// 抛出此异常，不向下执行
			throw new SkipPageException();
		}
	}
}
